module Shibboleth
  module Test
    module Aai
    
      #add dummy shibboleth headers
      def self.user request
        request.headers['Shib-OrgPerson-postalAddress'] = '1 street'
        request.headers['Shib-SwissEP-UniqueID'] = '123456789'
        request.headers['Shib-SwissEP-StaffCategory'] = '1234'
        request.headers['Shib-InetOrgPerson-preferredLanguage'] = 'en-en'
        request.headers['Shib-Person-surname'] = 'John'
        request.headers['Shib-SwissEP-Gender'] = 'm'
        request.headers['Shib-InetOrgPerson-givenName'] = 'Doe'
        request.headers['persistent-id'] = 'idp!service!12345679abcd'
        request.headers['Shib-SwissEP-HomeOrganizationType'] = 'org'
        request.headers['Shib-EP-Affiliation'] = 'org'
        request.headers['Shib-InetOrgPerson-mail'] = 'john.doe@domain.org'
        request.headers['Shib-SwissEP-HomeOrganization'] = 'org'
      end
    
      def self.new_user request
        id = Time.now.to_i.to_s
        user request
                
        request.headers['Shib-SwissEP-UniqueID'] = id
        request.headers['Shib-InetOrgPerson-surname'] = id + ' John '
        request.headers['Shib-InetOrgPerson-mail'] = id + '_john.doe@domain.org'
      end
    end
  end
end